package com.hao.desing.prototype;

import java.util.Date;

public class View implements Cloneable{
    String name;
    Date date;

    public View(String name, Date date) {
        this.name = name;
        this.date = date;
    }

    @Override
    protected Object clone() throws CloneNotSupportedException {
       Object obj= super.clone();
       View view=(View) obj;
       view.date=(Date) this.date.clone();
        return obj ;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Date getDate() {
        return date;
    }

    public void setDate(Date date) {
        this.date = date;
    }

    @Override
    public String toString() {
        return "View{" +
                "name='" + name + '\'' +
                ", date=" + date +
                '}';
    }
}
